#include "ZuiLib.h"
#include "ZControlFactory.h"


#define IMPL_ZCONTROL_FACTORY(name,control) \
	ZControlFactoryMgr::Instance()->AddFactory(name, CreateControlFuncImpl<control>)

namespace ZuiLib
{
	void RegisterControlFactory()
	{
		IMPL_ZCONTROL_FACTORY("Control", ZControl);
		IMPL_ZCONTROL_FACTORY("Button", ZButton);
		IMPL_ZCONTROL_FACTORY("MouseArea", ZMouseArea);

		IMPL_ZCONTROL_FACTORY("AnimationLayout", ZAnimationLayout);
		IMPL_ZCONTROL_FACTORY("ComboxItem", ZComboxItem);
		IMPL_ZCONTROL_FACTORY("Combox", ZCombox);

		IMPL_ZCONTROL_FACTORY("MenuItem", ZMenuItem);
		IMPL_ZCONTROL_FACTORY("Menu", ZMenu);

		IMPL_ZCONTROL_FACTORY("Container", ZContainer);

		IMPL_ZCONTROL_FACTORY("HorizontalLayout", ZHorizontalLayout);
		IMPL_ZCONTROL_FACTORY("HLayout", ZHorizontalLayout);
		IMPL_ZCONTROL_FACTORY("VerticalLayout", ZVerticalLayout);
		IMPL_ZCONTROL_FACTORY("VLayout", ZVerticalLayout);
		IMPL_ZCONTROL_FACTORY("PopupLayout", ZPopupLayout);

		IMPL_ZCONTROL_FACTORY("ImageControl", ZImageControl);
		IMPL_ZCONTROL_FACTORY("AnimateImageControl", ZAnimateImageControl);

		IMPL_ZCONTROL_FACTORY("Label", ZLabel);
		IMPL_ZCONTROL_FACTORY("Layout", ZLayout);

		IMPL_ZCONTROL_FACTORY("List", ZList);
		IMPL_ZCONTROL_FACTORY("ListCell", ZListCell);

		IMPL_ZCONTROL_FACTORY("LoadingControl", ZLoadingControl);
		IMPL_ZCONTROL_FACTORY("NetImageControl", ZNetImageControl);
		IMPL_ZCONTROL_FACTORY("Option", ZOption);

		IMPL_ZCONTROL_FACTORY("Progress", ZProgress);

		IMPL_ZCONTROL_FACTORY("RichText", ZRichText);

		IMPL_ZCONTROL_FACTORY("ScrollBar", ZScrollBar);

		IMPL_ZCONTROL_FACTORY("Slider", ZSlider);

		IMPL_ZCONTROL_FACTORY("TabLayout", ZTabLayout);
		IMPL_ZCONTROL_FACTORY("SliderTabLayout", ZSliderTabLayout);

		IMPL_ZCONTROL_FACTORY("Text", ZText);
		IMPL_ZCONTROL_FACTORY("TextEdit", ZTextEdit);

		IMPL_ZCONTROL_FACTORY("TextInput", ZTextInput);

		IMPL_ZCONTROL_FACTORY("BubbleList", ZBubbleList);
		IMPL_ZCONTROL_FACTORY("BubbleListCell", ZBubbleListCell);

		IMPL_ZCONTROL_FACTORY("TileLayout", ZTileLayout);

		IMPL_ZCONTROL_FACTORY("QrControl", ZQrControl);

		IMPL_ZCONTROL_FACTORY("DragReceiver", ZDragReceiver);

	#ifdef SUPPORT_VIDEO_CONTROL
		IMPL_ZCONTROL_FACTORY("VideoControl", ZVideoControl);
		IMPL_ZCONTROL_FACTORY("NetVideoControl", ZNetVideoControl);
	#endif
	}


}
